/* 储存供应商管理-初选列表api */

import { ajaxService } from '@/utils/request';

const env = import.meta.env;
let baseURL = env.VITE_SUPPLOER_URL;

// 获取供应商初选列表分页数据
export function GetSupplierPrimaryList(params: any) {
  return ajaxService({
    url: '/supplier/list/getAll',
    method: 'get',
    baseURL,
    params,
  });
}

// export interface SupplierHeader {
//   supplierType: number,
//   userId: number,
// }

// 获取供应商初选列表表头数据
export function GetSupplierPrimaryHeaderList(params?: any) {
  return ajaxService({
    url: '/supplier/list/header/get',
    method: 'get',
    baseURL,
    params,
  });
}

// 修改供应商初选列表表头数据
export function PutSupplierPrimaryHeaderList(data: any) {
  return ajaxService({
    url: '/supplier/list/header/edit',
    method: 'put',
    baseURL,
    data,
  });
}

// 获取供应商初选列表详情
export function GetSupplierPrimaryDetail(params: any) {
  return ajaxService({
    url: '/supplier/list/get',
    method: 'get',
    baseURL,
    params,
  });
}

// 新增供应商初选列表详情
export function PostSupplierPrimaryDetail(data: any) {
  return ajaxService({
    url: '/supplier/list/add',
    method: 'post',
    baseURL,
    data,
  });
}

// 修改供应商信息
export function putSupplierPrimaryDetail(data: any) {
  return ajaxService({
    url: '/supplier/list/edit',
    method: 'put',
    baseURL,
    data,
  });
}

// 删除供应商初选列表一项
export function DelSupplierPrimaryList(params: any) {
  return ajaxService({
    url: '/supplier/list/del',
    method: 'delete',
    baseURL,
    params,
  });
}

// 获取供应商初选列表详情
export function GetSupplierTemplateDetail(params: any) {
  return ajaxService({
    url: '/supplier/set/temp/getOpenTemplate',
    method: 'get',
    baseURL,
    params,
  });
}

// 获取全部供应商信息
export function GetSupplierList() {
  return ajaxService({
    url: '/supplier/auth/show/list',
    method: 'get',
    baseURL,
  });
}

// 获取全部供应商信息
export function PostSupplierProduct(data: any) {
  return ajaxService({
    url: '/supplier/list/product/add',
    data,
    method: 'post',
    baseURL,
  });
}

// 获取全部供应商信息
export function getSupplierInfo(params: any) {
  return ajaxService({
    url: '/supplier/auth/product/supplier',
    params,
    method: 'get',
    baseURL,
  });
}

// 修改供应商初选状态
export function setSupplierState(data: any) {
  return ajaxService({
    url: '/supplier/list/edit/change',
    data,
    method: 'put',
    baseURL,
  });
}
